import json
from copy import deepcopy
from enum import Enum
from pathlib import Path
from typing import List

import darkdetect
from PySide6.QtCore import QObject, Signal
from PySide6.QtGui import QColor
from qfluentwidgets.common.config import ConfigValidator


class FileValidator(ConfigValidator):
    """ Folder validator """

    def validate(self, value):
        return Path(value).exists()

    def correct(self, value):
        path = Path(value)
        return str(path.absolute()).replace("\\", "/")
